<html  xmlns:th="http://www.thymeleaf.org"
       xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta charset="utf-8">
    <title>米塔云平台管理系统</title>
    <link href="../plugins/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="../plugins/bootstrapValidator/bootstrapValidator.min.css" rel="stylesheet">
    <link href="../plugins/font-awesome/css/all.min.css" rel="stylesheet">
    <link href="../customize/css/iconfont.css" rel="stylesheet">
    <link href="../layuiadmin/layui/css/layui.css" rel="stylesheet">
    <link href="../customize/css/content.css" rel="stylesheet">
    <style>
        #typeListTree {
            height: 780px;
            overflow-y: auto;
        }

        a {
            color: #007bff;
        }

        a:hover {
            color: #0056b3;
        }

        .col-2 {
            margin-bottom: 1rem;
        }
    </style>
</head>
<body>
<div class="m-3">
    <nav class="mb-3 custom-section">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><i class="iconfont icon-xiaolan8"></i> 权限管理</li>
            <li class="breadcrumb-item active"><i class="iconfont icon-shebeileixingguanli"></i> 设备类型管理</li>
        </ol>
    </nav>
    <div class="d-flex">
        <div class="custom-section" style="width: 320px;">
            <button shiro:hasPermission="sys:type:opera" class="btn btn-primary mb-3" type="button"
                    onclick="addRootType()"><i class="fa fa-plus"></i> 新增
            </button>
            <div class="font-p14" id="typeListTree"></div>
        </div>
        <div class="ml-3 flex-1 custom-section">
            <div class="mb-3">设备类型：<span class="text-primary" id="deviceType_text"></span></div>
            <table class="table table-striped table-bordered table-center" id="device-List">
                <!--      <thead>
                      <tr>
                          <th>#</th>
                          <th>设备编号</th>
                          <th>设备名称</th>
                          <th>添加时间</th>
                          <th>归属企业</th>
                          <th>采集设备编号</th>
                          <th>维保周期</th>
                          <th>操作</th>
                      </tr>
                      </thead>
                      <tbody>
                      <tr>
                          <td>1</td>
                          <td>A00013</td>
                          <td>CNC7</td>
                          <td>2020-10-19 11:06:01</td>
                          <td>苏州市大华精密机械有限公司</td>
                          <td>AC1F09FFFE0146BD</td>
                          <td>200天</td>
                          <td>
                              <a href="##" onclick="viewInfo(1)">详情</a>
                          </td>
                      </tr>
                      </tbody>-->
            </table>
            <div id="page" class="page_div"></div>
        </div>
    </div>
</div>
<div shiro:hasPermission="sys:type:opera" class="modal fade" id="addInfoModal" data-backdrop="static" tabindex="-1">
    <div class="modal-dialog modal-dialog-centered">
        <form class="modal-content text-body" id="addInfoForm">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i><span>添加集合</span></div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="text-secondary font-p12 mb-3">注：带<span class="form-required">*</span><span
                        class="ml-3"></span>标识的为必填项
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-form-label">父级</label>
                    <div class="col-sm-8 font-p14">
                        <input type="text" readonly class="form-control-plaintext" id="validationCustom01" value="无">
                        <input type="hidden" id="validationCustom03" name="parentId">
                        <input type="hidden" id="validationCustom04" name="rank">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-form-label" for="validationCustom02">集合名称<span
                            class="form-required">*</span></label>
                    <div class="col-sm-8">
                        <input class="form-control" name="title" type="text" id="validationCustom02">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary">提交保存</button>
            </div>
        </form>
    </div>
</div>
<div shiro:hasPermission="sys:type:opera" class="modal fade" id="editInfoModal" data-backdrop="static" tabindex="-1">
    <div class="modal-dialog modal-dialog-centered">
        <form class="modal-content text-body" id="editInfoForm">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i><span>修改集合名称</span></div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="text-secondary font-p12 mb-3">注：带<span class="form-required">*</span><span
                        class="ml-3"></span>标识的为必填项
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-form-label">原名称</label>
                    <div class="col-sm-8 font-p14">
                        <input type="hidden" id="type_ID" name="id">
                        <input type="text" readonly class="form-control-plaintext" id="validationCustom11" value="无">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-3 col-form-label" for="validationCustom12">新名称<span
                            class="form-required">*</span></label>
                    <div class="col-sm-8">
                        <input class="form-control" name="title" type="text" id="validationCustom12">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary">提交保存</button>
            </div>
        </form>
    </div>
</div>
<div class="modal fade" id="viewInfoModal" data-backdrop="static" tabindex="-1">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content text-body">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i> 设备信息详情</div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body font-p14">
                <div class="modal-sub-title d-flex align-items-center mb-3">
                    <i class="iconfont icon-juxing text-primary"></i><span>基本信息</span>
                </div>

                <div class="container">
                    <div class="row no-gutters">
                        <div class="col-2">设备名称</div>
                        <div class="col-2"><strong id="name-id"></strong></div>
                        <div class="col-2 text-break">设备编号</div>
                        <div class="col-2"><strong id="sn-id"></strong></div>
                        <div class="col-2">归属企业</div>
                        <div class="col-2"><strong id="ename-id"></strong></div>

                        <div class="col-2">采集设备编号</div>
                        <div class="col-2 text-break"><strong id="ceqNumber-id"></strong></div>
                        <div class="col-2">站号</div>
                        <div class="col-2"><strong id="port-id"></strong></div>
                        <div class="col-2">维保周期</div>
                        <div class="col-2"><strong id="maintenanceCycle-id"></strong></div>

                        <div class="col-2">峰值电价</div>
                        <div class="col-2"><strong id="maxPrice-id"></strong></div>
                        <div class="col-2">平值电价</div>
                        <div class="col-2"><strong id="avgPrice-id"></strong></div>
                        <div class="col-2">谷值电价</div>
                        <div class="col-2"><strong id="minPrice-id"></strong></div>

                        <div class="col-4 mb-1">设备图片</div>
                        <div class="col-4 mb-1">设备类型</div>
                        <div class="col-4 mb-1">添加时间</div>
                        <div class="col-4 mb-3">
                            <img class="img-fluid" src="../customize/images/device-img.png" style="max-height: 200px;"
                                 alt="" id="logo-id">
                        </div>
                        <div class="col-4 mb-3">
                            <strong id="deviceType"></strong>
                        </div>
                        <div class="col-4 mb-3">
                            <strong id="createTime-id"></strong>
                        </div>
                    </div>
                </div>

                <div class="modal-sub-title d-flex align-items-center mb-3 mt-3">
                    <i class="iconfont icon-juxing text-primary"></i><span>报警阈值设置</span>
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col-2">电压峰值</div>
                        <div class="col-2"><strong id="maxU-id"></strong></div>
                        <div class="col-2">电流峰值</div>
                        <div class="col-2"><strong id="maxI-id"></strong></div>
                        <div class="col-2">电量峰值</div>
                        <div class="col-2"><strong id="maxC-id"></strong></div>
                        <div class="col-2">电压标准值</div>
                        <div class="col-2"><strong id="standardU-id"></strong></div>
                        <div class="col-2">电流标准值</div>
                        <div class="col-2"><strong id="standardI-id"></strong></div>
                        <div class="col-2">电量标准值</div>
                        <div class="col-2"><strong id="standardC-id"></strong></div>
                    </div>
                </div>

                <div class="modal-sub-title d-flex align-items-end mb-3 mt-3">
                    <i class="iconfont icon-juxing text-primary"></i><span>标定信息</span>
                    <small class="text-secondary ml-2 font-p14">用电分析标准值配置</small>
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col-2">额定功率</div>
                        <div class="col-2"><strong id="standardPower-id"></strong></div>
                    </div>
                </div>
                <div class="modal-sub-title d-flex align-items-end mb-3 mt-3">
                    <i class="iconfont icon-juxing text-primary"></i><span>工作功率阈值设置</span>
                    <small class="text-secondary ml-2 font-p14">用于判断设备状态</small>
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col-2">待机功耗</div>
                        <div class="col-2"><strong id="qddl"></strong></div>
<!--                        <div class="col-2">待机电流</div>-->
<!--                        <div class="col-2"><strong id="djdl"></strong></div>-->
                        <div class="col-2">电流比</div>
                        <div class="col-2"><strong id="dlb"></strong></div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<script src="../plugins/jquery-3.4.1.min.js"></script>
<script src="../plugins/bootstrap/bootstrap.min.js"></script>
<script src="../plugins/bootstrapValidator/bootstrapValidator.min.js"></script>
<script src="../plugins/bootstrapValidator/zh_CN.js"></script>
<script src="../layuiadmin/layui/layui.js"></script>
<script src="../plugins/alert.js"></script>
<script src="../plugins/paging.js"></script>
<script src="../customize/js/common.js"></script>
<script src="../customize/js/CommonUtils.js"></script>
<script src="../customize/js/customModalV2.js"></script>
<script src="../customize/js/typeManagement.js"></script>
<script>
    var opera = [];
    var path = "/device/getDeviceProduceByEnterpise";
</script>

<shiro:hasPermission name="sys:type:opera">
    <script>
        opera = ['add', 'update', 'del'];
    </script>
</shiro:hasPermission>

<shiro:hasRole name="系统管理组">
    <script>
        path = "/deviceType/selectDeviceTypeTree";
    </script>
</shiro:hasRole>
</body>
</html>